import { addScopeAPI, fetchBusinessScopeAPI } from '@/api/essentialDataAPI/institutionsAreaAPI'

const actions = {
  /*
  * 获取业务范围的action
  *  */
  async fetchBusinessScopeAction(context, { id, type }) {
    const { data } = await fetchBusinessScopeAPI({ id, type })
    return data
  },
  /*
  * 保存业务范围的接口
  *  */
  async addScopeAction(context, formData) {
    await addScopeAPI(formData)
    return '机构作业范围保存成功'
  }
}
const mutations = {}
const state = () => {
  return {}
}

export default {
  actions,
  mutations,
  state,
  namespaced: true
}
